//
//  ZJNavigationController.m
//  Lottery
//
//  Created by ZJ on 2018/8/14.
//  Copyright © 2018年 iCatch Technology Inc. All rights reserved.
//

#import "ZJNavigationController.h"

@interface ZJNavigationController ()

@end

@implementation ZJNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    /**
     UIBarMetricsDefault, // 默认值, 当前设置的图片会在竖屏、横屏下（带 prompt 或者不带 prompt）都显示这个图片
     UIBarMetricsCompact, // 只在横屏下显示当前设置的图片(并且不带prompt)
     UIBarMetricsDefaultPrompt = 101, // 只有在导航条带 prompt 的时候才会应用这个图片
     UIBarMetricsCompactPrompt, // 只有在横屏下同时导航条带 prompt 的时候才会应用这个图片
     
     UIBarMetricsLandscapePhone, // 已过时, 使用 UIBarMetricsCompact 代替
     UIBarMetricsLandscapePhonePrompt, // 已过时, 使用 UIBarMetricsCompactPrompt 代替
     
     所以一般都用 UIBarMetricsDefault, 一次设置到处都能应用
     */
    
    // 设置导航栏图片
    [self.navigationBar setBackgroundImage:[UIImage imageNamed:@"NavBar64"] forBarMetrics:UIBarMetricsDefault];
    
    // 设置文字为白色
    [self.navigationBar setTitleTextAttributes:@{
                                                 NSForegroundColorAttributeName: [UIColor whiteColor],
                                                 }];
    
    // 设置渲染的颜色
    [self.navigationBar setTintColor:[UIColor whiteColor]];
}

// 状态栏颜色
- (UIStatusBarStyle)preferredStatusBarStyle {
    return UIStatusBarStyleLightContent;
}

// 以后只要使用这个 nav 去push 那么都隐藏tabbar
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
    viewController.hidesBottomBarWhenPushed = YES;
    
    [super pushViewController:viewController animated:animated];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
